using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmPurchaseRequestItem")]
    public class PurchaseRequestItem
    {
        public PurchaseRequestItem()
        {
        }
    
		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "PrItemId", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int PrItemId { get; set; }

        [ForeignKey("MasBudgetExpense")]
		[DataMember, Display(Name = "BgExpId", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int BgExpId { get; set; }

		[ForeignKey("PurchaseRequest")]
		[DataMember, Display(Name = "PrId", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int? PrId { get; set; }

        [ForeignKey("MasResourceItem")]
		[DataMember, Display(Name = "ResItemId", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int? ResItemId { get; set; }

		[DataMember, Display(Name = "PrItemDescr", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public string Descr { get; set; }

        [DataMember]
        public bool? HaveItem { get; set; }

		[DataMember, Display(Name = "PrItemOriQty", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int? OriQty { get; set; }

		[DataMember, Display(Name = "PrItemMinPrice", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public decimal? MinPrice { get; set; }

		[DataMember, Display(Name = "PrItemMaxPrice", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public decimal? MaxPrice { get; set; }

        [DataMember, Display(Name = "PrItemStdPrice", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public decimal? StdPrice { get; set; }

		[DataMember, Display(Name = "PrItemQty", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public int? Qty { get; set; }

		[DataMember, Display(Name = "PrItemPrice", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public decimal? Price { get; set; }

        [DataMember, Display(Name = "Amount", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public decimal? Amount { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.PurchaseRequestItemResource))]
        public string RecordStatus { get; set; }

		[DataMember]
        public virtual PurchaseRequest PurchaseRequest { get; set; }

        [DataMember]
        public virtual BGM.MasBudgetExpense MasBudgetExpense { get; set; }
         
        [DataMember]
        public virtual ICM.MasResourceItem MasResourceItem { get; set; }
    }
}